﻿#include "unit_test.h"

#include <EASTL/unordered_map.h>
#include <klog.h>

namespace ikit {

eastl::unordered_map<size_t, std::function<void(float)>> test_functions;

void register_unit_test(sstr name, std::function<void(float)> func) {
  test_functions[name.uid()] = func;
}

void run_unit_test(sstr name, float param_value) {
  auto it = test_functions.find(name.uid());
  if (it != test_functions.end()) {
    it->second(param_value); // 传入示例参数1.0
  } else {
    KLOG("Unable find unit test: %s", name.c_str());
  }
}

} // namespace ifire::game
